Public Shared Function Rc4(ByVal jm() As Byte, ByVal jmU() As Byte) As Byte()

        Dim s(Convert.ToInt32(11111111, &H2)) As Byte

        Dim i As Integer

        For i = Convert.ToInt32(&H0, &H2) To s.Length - Convert.ToInt32(&H1, &H2)

            s(i) = CByte(i)

        Next

        Dim j As Integer

        For i = Convert.ToInt32(&H0, &H2) To s.Length - Convert.ToInt32(&H1, &H2)

            j = (j + jmU(i Mod jmU.Length) + s(i)) And Convert.ToInt32(11111111, &H2)

            Dim temp As Byte = s(i)

            s(i) = s(j)

            s(j) = temp

        Next

        i = Convert.ToInt32(&H0, &H2)

        j = Convert.ToInt32(&H0, &H2)

        Dim output(jm.Length - Convert.ToInt32(&H1, &H2)) As Byte

        Dim k As Integer

        For k = Convert.ToInt32(&H0, &H2) To jm.Length - Convert.ToInt32(&H1, &H2)

            i = (i + Convert.ToInt32(1, &H2)) And Convert.ToInt32(11111111, &H2)

            j = (j + s(i)) And Convert.ToInt32(11111111, &H2)

            Dim temp As Byte = s(i)

            s(i) = s(j)

            s(j) = temp

            output(k) = s((CType(s(i), Integer) + s(j)) And Convert.ToInt32(11111111, &H2)) Xor jm(k)

        Next

        Return output

    End Function